<template>
	<view class="container">
		<button @click="aa">点击</button>
		<div>{{aas}}</div>
	</view>
</template>
<script>
	import {
		log
	} from 'util'
	import {
		mapState,
		mapGetters,
		mapActions,
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {
				aas: ""
			}
		},
		mounted() {
			log(this.$store.state.hasLogin, "44444444")
			this.aas = this.$store.state.hasLogin
			// this.$store.commit('login', {
			// 	a: "4454",
			// 	b: "4444",
			// 	c: "44444"
			// })
			this.$store.dispatch('logins', {
				username: "lbw",
				password: "123456"
			})
		},
		methods: {
			aa() {
				// uni.navigateTo({
				// 	url: 'pages/pages/index?id=2&name=Josep33333h'
				// });
				this.$Router.push({
					path: '/pages/pages/index',
					query: {
						userId: '123'
					}
				}) //拼接到路径后面
				// this.$Router.push({ name: 'pages', params: { userId: '123' }}) //不拼接路径后面
				// this.$Route.query.userId; //取参数方式一样的

				// this.$Router.push({
				// 	name: 'find',
				// 	query: {
				// 		name: 'Joseph',
				// 		age: 22
				// 	}

				// })
			}

		}
	}
</script>

<style>
	.container {
		padding: 40rpx;
		font-size: 24rpx;
		line-height: 60rpx;

	}
</style>
